package cn.tedu.imop.basic.service.impl;

import cn.tedu.imop.basic.dao.repository.StoreRepository;
import cn.tedu.imop.basic.entity.Business;
import cn.tedu.imop.basic.entity.Store;
import cn.tedu.imop.basic.service.StoreService;
import cn.tedu.imop.common.pojo.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class StoreServiceImpl implements StoreService {

    private StoreRepository storeRepository;
    @Autowired
    public StoreServiceImpl(StoreRepository storeRepository) {
        this.storeRepository = storeRepository;
    }
    @Override
    public PageData<Store> getStoreList(Store store) {
        return storeRepository.selectStoreList(store);
    }

    @Override
    public Boolean createStore(Store store) {
        //存储店铺基础信息
        store.setCreateTime(new Date());
        storeRepository.insertStore(store);
        //存储店铺图片信息(将上传的图片和店铺信息绑定在一起)
        //这里的实现需要调用远程附件服务
        return true;
    }
}
